add_subcomponent fails. Could require 'tzinfo' in sample below,
but that doesn't seem right.
!/us/bin/ruby
require 'rubygems'
require 'ri_cal'
timezone = <<eos
BEGIN:VTIMEZONE
TZID:America/Denver
X-LIC-LOCATION:America/Denver
BEGIN:DAYLIGHT
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
TZNAME:MDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
TZNAME:MST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
eos
cheap_groceries = <<eos
BEGIN:VEVENT
DTSTART;TZID=America/Denver:20090414T133000
DTEND;TZID=America/Denver:20090414T143000
RRULE:FREQ=MONTHLY;BYDAY=2TU;WKST=MO
DTSTAMP:20090508T200622Z
UID:bcitgfe061at69cmnjo4403dbc@google.com
CLASS:PRIVATE
CREATED:00001231T000000Z
DESCRIPTION:
LAST-MODIFIED:20090416T184131Z
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:Safeway
TRANSP:OPAQUE
END:VEVENT
eos
tz = RiCal.parse_string(timezone).pop
cg = RiCal.parse_string(cheap_groceries).pop
cal = RiCal::Component::Calendar.new
cal.add_subcomponent(tz)
cal.add_subcomponent(cg)
puts "#{cal.events}"
=begin Fails:
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/required_timezones.rb:15:in
initialize': uninitialized constant
RiCal::RequiredTimezones::RequiredTimezone::TZInfo (NameError) from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/required_timezones.rb:52:innew'
from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/required_timezones.rb:52:in
add_datetime' from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/property_value/date_time.rb:295:inadd_date_times_to'
from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/component.rb:190:in
add_property_date_times_to' from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/properties/event.rb:1501:inadd_date_times_to'
from
/usr/lib/ruby/gems/1.8/gems/ri_cal-0.0.10/lib/ri_cal/component/calendar.rb:72:in
add_subcomponent' from ./test.rb:51 =end